package com.lianxian.xindong.login.mvp.presenter;

import android.app.Application;
import android.content.Intent;

import com.alibaba.android.arouter.launcher.ARouter;
import com.hxb.library.integration.AppManager;
import com.hxb.library.di.scope.ActivityScope;
import com.hxb.library.mvp.BasePresenter;
import com.hxb.library.http.imageloader.ImageLoader;

import me.jessyan.rxerrorhandler.core.RxErrorHandler;

import javax.inject.Inject;

import com.lianxian.xindong.commonsdk.core.RouterHub;
import com.lianxian.xindong.login.mvp.contract.OtherStepThreeContract;
import com.lianxian.xindong.login.mvp.model.entity.TagHobbyBean;
import com.lianxian.xindong.login.mvp.ui.adapter.TagHobbyAdapter;

import java.util.List;


/**
 * @作者：hexingbo
 * @时间：07/04/2023
 * @描述：
 */
@ActivityScope
public class OtherStepThreePresenter extends BasePresenter<OtherStepThreeContract.Model, OtherStepThreeContract.View> {
    @Inject
    RxErrorHandler mErrorHandler;
    @Inject
    Application mApplication;
    @Inject
    ImageLoader mImageLoader;
    @Inject
    AppManager mAppManager;
    @Inject
    TagHobbyAdapter mAdapter;
    @Inject
    List<TagHobbyBean> mDataList;

    @Inject
    public OtherStepThreePresenter(OtherStepThreeContract.Model model, OtherStepThreeContract.View rootView) {
        super(model, rootView);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.mErrorHandler = null;
        this.mAppManager = null;
        this.mImageLoader = null;
        this.mApplication = null;
    }

    /**
     * 获取兴趣爱好词汇库
     */
    public void getHobbyData() {
        mDataList.clear();
        mDataList.add(new TagHobbyBean("0", "唱歌"));
        mDataList.add(new TagHobbyBean("1", "跳舞"));
        mDataList.add(new TagHobbyBean("2", "唱歌跳舞"));
        mDataList.add(new TagHobbyBean("3", "酒吧"));
        mDataList.add(new TagHobbyBean("4", "旅游"));
        mDataList.add(new TagHobbyBean("5", "撸猫"));
        mDataList.add(new TagHobbyBean("6", "爬山"));
        mDataList.add(new TagHobbyBean("7", "游泳"));
        mAdapter.notifyDataChanged();
    }

    /**
     * 提交数据，跳转主界面
     */
    public void submitOtherStepInfo() {
        ARouter.getInstance()
                .build(RouterHub.APP_MAINACTIVITY)
                .navigation(mApplication);
        mRootView.killMyself();
    }
}
